<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        /* 群组 */
        html,body{
            /* 清除html18个像素的白边 */
            margin: 0;
            padding: 0;
            height: 100%;
            /* 父盒子要给子元素创造足够的空间 */
            width: 100%;
        }
        .bg{
            height: 100%;
            width: 100%;
            background-size: cover;
            background-position: center center;
            background-attachment: fixed;
        }
        .mg1{
            background-image: url("https://images.pexels.com/photos/1097491/pexels-photo-1097491.jpeg");
        }
        .mg2{
            background-image: url("https://images.pexels.com/photos/2437299/pexels-photo-2437299.jpeg");
        }
        .mg3{
            background-image: url("https://images.pexels.com/photos/1005417/pexels-photo-1005417.jpeg");
        }
    </style>
</head>
<body>
    <div class="bg mg1"></div>
    <div class="bg mg2"></div>
    <div class="bg mg3"></div>
</body>
</html>